package com.spring.cloud.module.common.exception;

import org.apache.logging.log4j.Level;

/**
 * 统一业务业务逻辑异常
 */
public abstract class BaseExcepiton extends RuntimeException {

    private int code;

    private Level level = Level.ERROR;

    BaseExcepiton(int code, String msg, Throwable e) {
        super(msg, e);
        this.code = code;
    }

    BaseExcepiton(int code, String msg) {
        super(msg);
        this.code = code;
    }

    BaseExcepiton(int code, String msg, Level level) {
        super(msg);
        this.code = code;
        this.level = level;
    }

    BaseExcepiton(int code, String msg, Level level, Throwable e) {
        super(msg, e);
        this.code = code;
        this.level = level;
    }

    public int getCode() {
        return code;
    }

    public Level getLevel() {
        return level;
    }
}
